Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
validate.io-number-primitive-array
Advanced tools
Validates if a value is an array of primitive numbers, excluding NaN.
Validates if a value is an array of primitive numbers.
$ npm install validate.io-number-primitive-array
For use in the browser, use browserify.
var isNumberArray = require( 'validate.io-number-primitive-array' );
Validates if a value
is an array
of number
primitives, excluding NaN.
var arr = [1,2,3];
var bool = isNumberArray( arr );
// returns true
Note: the method will return false
for an empty array
.
var isNumberArray = require( 'validate.io-number-primitive-array' );
console.log( isNumberArray( [1,2,3] ) );
// returns true
console.log( isNumberArray( [ new Number( 1 ) ] ) );
// returns false
console.log( isNumberArray( [] ) );
// returns false
console.log( isNumberArray( [ NaN ] ) );
// returns false
console.log( isNumberArray( ['a','b','c'] ) );
// returns false
To run the example code from the top-level application directory,
$ node ./examples/index.js
Unit tests use the Mocha test framework with Chai assertions. To run the tests, execute the following command in the top-level application directory:
$ make test
All new feature development should have corresponding unit tests to validate correct functionality.
This repository uses Istanbul as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:
$ make test-cov
Istanbul creates a ./reports/coverage
directory. To access an HTML version of the report,
$ make view-cov
Copyright © 2015. Athan Reines.
FAQs
Validates if a value is an array of primitive numbers, excluding NaN.
The npm package validate.io-number-primitive-array receives a total of 218 weekly downloads. As such, validate.io-number-primitive-array popularity was classified as not popular.
We found that validate.io-number-primitive-array demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.